package com.yuanyu.controller;

import com.yuanyu.common.util.ResultInfoUtil;
import com.yuanyu.model.vo.Assembly_record_of_dry_pumpVO;
import com.yuanyu.model.vo.ResultInfo;
import com.yuanyu.server.ITestPart5Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/part5")
public class TestPart5Controller {
    @Autowired
    private ITestPart5Server testPart5Server;

    @GetMapping("/test")
    public ResultInfo test(){
        System.out.println("这是测试界面");
        return ResultInfoUtil.buildSuccess(testPart5Server.test());
    }
    @PostMapping("/add")
    public ResultInfo part(@RequestBody Assembly_record_of_dry_pumpVO assemblyRecordOfDryPumpVO){
        System.out.println(assemblyRecordOfDryPumpVO.toString());
        return ResultInfoUtil.buildSuccess(testPart5Server.test5(assemblyRecordOfDryPumpVO));
    }
    @PostMapping("/update")
    public ResultInfo updatePart(@RequestBody Assembly_record_of_dry_pumpVO assemblyRecordOfDryPumpVO){
        System.out.println(assemblyRecordOfDryPumpVO.toString());
        return ResultInfoUtil.buildSuccess(testPart5Server.updateTable5(assemblyRecordOfDryPumpVO));
    }
    @GetMapping("/value/{Case}")
    public ResultInfo partValue(@PathVariable("Case") String Case){
        System.out.println(Case);
        return ResultInfoUtil.buildSuccess(testPart5Server.getTest5(Case));
    }
}
